home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Trading on the Edge
/
Trading On The Edge - CD-ROM Toolkit (Wayzata Technology)(2031)(1994).bin
/
pc
/
mac_file
/
vendor_d
/
neuralwa
/
nw2v50
/
host.h
< prev
next >
Wrap
Text File
|
1993-08-23
|
29KB
|
1,283 lines
/* host.h - Variations between host machines/compilers defined here. */
/************************************************************************
* Copyright(C) 1987-1992 NeuralWare Inc *
* Penn Center West, IV-227, Pittsburgh, PA 15276 *
* Telephone: (412) 787-8222 FAX: (412) 787-8220 *
* *
* All rights reserved. No part of this program may be reproduced, *
* stored in a retrieval system, or transmitted, in any form or by any *
* means, electronic, mechanical, photocopying, recording or otherwise *
* without the prior written permission of the copyright owner, *
* NeuralWare, Inc. *
* *
* PROPRIETARY NOTICE *
* *
* This document is the property of NeuralWare, Inc. and contains *
* trade-secrets and other proprietary information. The information *
* herein is reserved as proprietary to NeuralWare, and is not to be *
* published, reproduced, copied, disclosed, used, or reverse *
* engineered without the express written consent of a duly authorized *
* representative of NeuralWare. *
************************************************************************
*/
/* TM : 06-Sep-90: pull together all information into single file */
/* AWP, TM - add platform detection, more generic #ifdefs */
/* I find it curious that INT is defined in only one case - the IBP model */
#ifndef HOST_H
#define HOST_H 1
/*
* -----------------------------------------------------------------------
* SEC 1. MAP SOFTWARE/PLATFORM #IFDEFS ONTO SPECIFIC MACHINE TYPES
* -----------------------------------------------------------------------
*/
#define MULTIPLAT **error** -- multiple definitions for this platform
#if defined(_CRAY) && defined(_UNICOS)
/* --------------- CRAY ( psc ) --------------- */
#ifdef platform
MULTIPLAT
#endif
#define platform
#ifndef CRAY
#define CRAY 1
#endif
#endif
#if defined(mips) && defined(nec) && defined(nec_e48m220) && defined(nec_ews) && defined(nec_ews_risc1) && defined(nec_ews_svr4) && defined(r3000) && defined(unix)
/* --------------- NEC/EWS ( amygdala ) --------------- */
#ifdef platform
MULTIPLAT
#endif
#define platform
#ifndef EWS
#define EWS 1
#endif
#endif
#if defined(__hpux) && defined(__unix)
/* --------------- HP700 ( bourbon ) --------------- */
#ifdef platform
MULTIPLAT
#endif
#define platform
#ifndef HP700
#define HP700 1
#endif
#endif
#if defined(__sgi) && defined(__mips) && defined(__host_mips) && defined(__unix)
/* --------------- IRIS/INDIGIO ( xyzzy ) --------------- */
#ifdef platform
MULTIPLAT
#endif
#define platform
#ifndef IRIS
#define IRIS 1
#endif
#endif
#if defined(bsd4_2) && defined(ultrix) && defined(unix) && defined(vax)
/* --------------- VAX/ULTRIX ( rhemi ) --------------- */
#ifdef platform
MULTIPLAT
#endif
#define platform
#ifndef VAXULT
#define VAXULT 1
#endif
#endif
#if defined(vax) && defined(vax11c) && defined(vms)
/* --------------- Vax/VMS ( lhemi ) --------------- */
#ifdef platform
MULTIPLAT
#endif
#define platform
#ifndef VMS
#define VMS 1
#define VAXC /* VAX-C compiler: true for the VMS under which NWII is built */
#endif
#endif
#if defined(sparc) && defined(sun) && defined(unix)
/* --------------- SUN4 ( lobe ) or SOLARIS (pons) --------------- */
/* oddly enough, while the cc defines sun4 in this case,
cpp does not. */
#ifdef platform
MULTIPLAT
#endif
#define platform
#ifdef __STDC__
#ifndef SOLARIS
#define SOLARIS 1
#endif
#else
#ifndef SUN4
#define SUN4 1
#endif
#endif
#endif
#if defined(mc68000) && defined(mc68020) && defined(sun) && defined(sun3) && defined(unix)
/* --------------- SUN3 ( dendrite ) --------------- */
#ifdef platform
MULTIPLAT
#endif
#define platform
#ifndef SUN3
#define SUN3 1
#endif
#endif
#if defined(i386) && defined(sun) && defined(sun386) && defined(unix)
/* --------------- SUN386 ( my386 ) --------------- */
#ifdef platform
MULTIPLAT
#endif
#define platform
#ifndef SUN386
#define SUN386 1
#endif
#endif
#if defined(i386) && !defined(sun) && defined(unix)
/* --------------- PS2AIX (psyche ) --------------- */
#ifdef platform
MULTIPLAT
#endif
#define platform
#ifndef PS2AIX
#define PS2AIX 1
#endif
#endif
#if defined(SUN3) || defined (SUN386) || defined (SUN4)
/* force SUN definition */
#define SUN 1
#endif
/*
* -----------------------------------------------------------------------
* SEC 2. Set up defaults
* -----------------------------------------------------------------------
*/
/* undef INT_EQ_SHORT, INT_EQ_LONG by default;
one must be defined, depending upon the compiler */
#undef INT_EQ_SHORT
#undef INT_EQ_LONG
/* some compilers do not permit sizeof(int) to be used in a macro; if
yours does, define SIZEOF_MACRO_OK */
#undef SIZEOF_MACRO_OK
#if !defined(_STDIO_H)
#include <stdio.h>
#endif
#if defined(SKY) && !defined(fileno)
/* riddle this: SKY's stdio.h will not define fileno unless _K_AND_R
is set or _MSDOS and __HIGHC__ are set. */
#define fileno(__stream) ((__stream)->_file)
#endif
/*
* -----------------------------------------------------------------------
* SEC 3. For each "platform" specify ...
* The following symbols should be defined as 1 if applicable;
* undefined otherwise
*
* PROTOTYPING : supports function prototyping (or tolerates the syntax)
* ANSI_HEADER : supports new style function header
*
* ELLIPSIS : should be defined as "..." or nothing, depending upon
* what should be in the last argument of a prototype to indicate
* that the number of args is variable
* IBM_TYPE : this product is being built for some sort of IBM AT
* variant - possibilities include standard IBM, NEC, and FUJITSU
*
* one of the xxx_KEYS options must be selected, except for X versions
*
* IBM_KEYS
* NEC_KEYS
* FUJITSU_KEYS
* SUN_KEYS
* -----------------------------------------------------------------------
*/
/**/
#if (!defined(HOST_IS) && defined(__ZTC__))
#define HOST_IS "IBM AT,MS-DOS,ZORTECH C"
#define IBM_TYPE 1
#define MSDOS 1 /* operating system (predefined by */
/* Zortech preprocessor) */
#ifndef DLC
#define DLC 1 /* compiler - for historical reasons */
#endif
#define PROTOTYPING 1 /* compiler supports function prototyping */
#define ANSI_HEADER 1
#define ELLIPSIS ...
#define INT_EQ_SHORT 1
#define SIZEOF_MACRO_OK 1
#endif /* __ZTC */
/**/
#if (!defined(HOST_IS) && defined(__TURBOC__))
#define HOST_IS "IBM AT,MS-DOS,TURBO C"
#define IBM_TYPE 1
#define MSDOS 1 /* operating system (predefined by */
/* Zortech preprocessor) */
#define PROTOTYPING 1 /* compiler supports function prototyping */
#define ANSI_HEADER 1
#define ELLIPSIS ...
#define INT_EQ_SHORT 1
#define SIZEOF_MACRO_OK 1
#endif /* __TURBOC__ */
/**/
/* M_I86 and MSDOS are predefined by Microsoft C compiler */
#if (!defined(HOST_IS) && defined(M_I86))
#define HOST_IS "IBM 80x86,MS-DOS,MSC 6.0"
#define IBM_TYPE 1
/* changed MSC version from 6 to 7; 4-28-93 mjs */
#define MSC 7 /* set MSC to the version */
/* added for ergo realloc() bug; 5-27-93 mjs */
#ifdef PM2
#ifndef DOSX286
#define malloc(a) ergo_malloc(a)
#define calloc(a,b) ergo_calloc(a,b)
#define realloc(a,b) ergo_realloc(a,b)
#define free(a) ergo_free(a)
void *ergo_malloc(unsigned);
void *ergo_calloc(unsigned,unsigned);
void *ergo_realloc(void *,unsigned);
void ergo_free(void *);
#endif
#endif
/* debugging macros - appends debug lines to a file on a PC-NFS mounted
* drive so the file can be viewed with a "tail -f" on UNIX
*/
#define DMP1(a) {FILE *F; fprintf(F=fopen("q:\\d","a"),a);fclose(F);}
#define DMP2(a,b) {FILE *F; fprintf(F=fopen("q:\\d","a"),a,b);fclose(F);}
#define DMP3(a,b,c) {FILE *F; fprintf(F=fopen("q:\\d","a"),a,b,c);fclose(F);}
#define DMP4(a,b,c,d) {FILE *F; fprintf(F=fopen("q:\\d","a"),a,b,c,d);fclose(F);}
#define PROTOTYPING 1 /* compiler supports function prototyping */
#define ANSI_HEADER 1
#define ELLIPSIS ...
#define INT_EQ_SHORT 1
#endif /* M_I86 */
/**/
/* IBM AT, MS-DOS, Turbo C */
#if (!defined(HOST_IS) && defined(__TURBOC__))
#define HOST_IS "IBM AT,MS-DOS,TURBO C"
#define IBM_TYPE 1
#define MSDOS 1 /* operating system */
#define PROTOTYPING 1 /* compiler supports function prototyping */
#define ANSI_HEADER 1
#define ELLIPSIS ...
#define INT_EQ_SHORT 1
#define SIZEOF_MACRO_OK 1
/* Default 0 pointer type */
#ifndef NULL
#if LPTR
#define NULL (0L)
#else
#define NULL 0
#endif
#endif
#endif /* __TURBOC__ */
/**/
#if defined(IBP) /* { */
#if _MSC_VER == 800 /* MS-Windows NT C compiler { */
#define __MSNT__
#define HOST_IS "IBM 386,MS-DOS,MS-NT C"
#define IBM 1
#define IBM_TYPE 1
#define PM32 1
#define MSDOS 1
#define INT_EQ_LONG 1
#define stdprn stderr
#else /* _MSC_VER }{*/
#include <stdarg.h>
/* This must come after the __ZTC__, */
#define assert(e) ((e) || (_assert("e",__FILE__,__LINE__),1))
/* Added for NDP V4.2.1 -jsb */
#define _assert _Assert
extern void _assert(char *, char *, unsigned);
/* See if MicroWay fixed the CR/LF problem -jsb
**
** #define fprintf ndp_fprintf
** #define vfprintf ndp_vfprintf
** #define fputs ndp_fputs
** #define fputc ndp_fputc
** int ndp_vfprintf(FILE *stream, const char *format, va_list arg);
** int ndp_fprintf(FILE *stream, const char *format, ...);
** int ndp_fputs(const char *s, FILE *stream);
** int ndp_fputc(int c, FILE *stream);
*/
#ifndef M_I86
#ifndef __TURBOC__
#ifndef __ZTC__ /* this stuff runs under protected mode */
#define HOST_IS "IBM 386,MS-DOS,NDP C"
#define IBM_TYPE 1
#ifndef IBM
#define IBM 1
#endif
#ifndef MSDOS
#define MSDOS 1 /* operating system - defined as arg to make */
#endif
#define NDP 1 /* compiler */
#define stdprn stderr
#define PROTOTYPING 1
#define ANSI_HEADER 1
#define ELLIPSIS ...
#define INT_EQ_LONG 1
/* Default 0 pointer type */
#ifndef NULL
#define NULL (0L)
#endif
/* Unsupported type syntax */
#define signed
#define volatile
#define far
#else /* __ZTC__ */
#define SERVER 1
#endif /* __ZTC__ */
#else /* __TURBOC__ */
#define SERVER 1
#endif /* __TURBOC__ */
#else /* M_I86 */
#define SERVER 1
#endif /* M_I86 */
#endif /* _MSC_VER } */
#endif /* } IBP */
/**/
/* The I860 set may be called when HOST_IS has already been defined */
/* This must come after the M_I86 stuff */
#if defined(M860) || defined(A860) || defined(W860)
#define TWO_MACHINE_MODEL 1
#define I860 1
#ifndef M_I86
#define WORKER 1
#ifdef M860
#define HOST_IS "I860, MS-DOS, GreenHills C"
#else
#ifdef A860
#define HOST_IS "I860, MS-DOS, MetaWare C"
#define assert(e) ((e) || (_assert("e",__FILE__,__LINE__),1))
extern void _assert(char *, char *, unsigned);
#else
/* W860 */
#define HOST_IS "I860, MS-DOS, ???????? C"
#endif
#endif
#define IBM_TYPE 1
#ifndef IBM
#define IBM 1
#endif
#ifndef MSDOS
#define MSDOS 1 /* operating system - defined as arg to make */
#endif
#define stdprn stderr
#define NDP 1 /* compiler */
#define PROTOTYPING 1
#define ANSI_HEADER 1
#define ELLIPSIS ...
#define INT_EQ_LONG 1
/* Default 0 pointer type */
#ifndef NULL
#define NULL (0L)
#endif
/* Unsupported type syntax */
#define signed
#define volatile
#define far
#else /* M_I86 */
#define SERVER 1
#endif /* M_I86 */
#endif /* I860 set */
/**/
#if (!defined(HOST_IS) && defined(NEXT))
#define HOST_IS "NeXT, Mach, GNU C"
/* machine: Symbol NeXT is defined by GNU C compiler */
/* operating system: Symbol __MACH__ is defined by GNU C compiler */
/* compiler: Symbol __GNUC__ is defined when compiling ".c", */
/* ".s", or ".m" files */
/* Symbol __OBJC__ is defined when compiling */
/* Objective C ".m" files */
#ifndef NEXTSTD_H
#include "appkit/nextstd.h"
/* brings in math.h, stdio.h, and others */
/* nextstd.h is included by appkit.h if */
/* NEXTSTD_H is not defined */
#endif
#define UNIX 1
#define PROTOTYPING 1 /* GNU C compiler supports prototyping */
#define ANSI_HEADER 1
#define ELLIPSIS
#define INT_EQ_LONG 1
/* Default 0 pointer type */
#ifndef NULL
#define NULL (0)
#endif
typedef void *windowhandle_t; /* whenever used should be cast to id !! */
typedef struct
{
float red;
float green;
float blue;
}RGBColor; /* define an RGB color structure */
#endif /* NEXT */
/**/
#if (!defined(HOST_IS) && defined(RS6))
#define HOST_IS "RS-6000,AIX"
#ifndef AIXOS
#define AIXOS 1 /* AIX operating system */
#endif
#define UNIX 1
#define DGXWIN 1 /* X-windows environment */
#define PROTOTYPING 1
#define ANSI_HEADER 1
#define ELLIPSIS ...
#define INT_EQ_LONG 1
#undef signed /* chars are unsigned */
#define const
#define volatile
#define cdecl
#ifndef _POSIX_SOURCE
typedef char * caddr_t; /* RS6000 defines caddr_t only
for POSIX_SOURCE */
#endif /* not _POSIX_SOURCE */
#endif /* RS6 */
/**/
#if (!defined(HOST_IS) && defined(PS2AIX))
#define HOST_IS "PS/2,AIX"
#ifndef AIXOS
#define AIXOS 1 /* AIX operating system */
#endif
#define UNIX 1
#define DGXWIN 1 /* X-windows environment */
#define PROTOTYPING 1
#define ANSI_HEADER 1
#define ELLIPSIS ...
#define INT_EQ_LONG 1
#undef signed /* chars are unsigned */
#define const
#define volatile
#define cdecl
#endif /* PS2AIX */
/**/
#if (!defined(HOST_IS) && defined(VAXULT))
#define HOST_IS "VAX,ULTRIX"
#ifndef ULTRIX
#define ULTRIX 1 /* DEC Ultrix operating system */
#endif
#define UNIX 1
#define DGXWIN 1 /* X-windows environment */
#undef ANSI_HEADER
#undef PROTOTYPING
#define ELLIPSIS ...
#define INT_EQ_LONG 1
#endif /* VAXULT */
/**/
#if (!defined(HOST_IS) && defined(VMS))
#define HOST_IS "VAX,VMS"
#ifndef VAXC
#define VAXC 1 /* VAXC: VMS simulated DEC Ultrix operating system */
#endif
#define UNIX 1
#define DGXWIN 1 /* X-windows environment */
#undef ANSI_HEADER
#undef PROTOTYPING
#define ELLIPSIS ...
#define INT_EQ_LONG 1
#define getcwd vms_getcwd
/* #define fgets vms_fgets */ /* out for now XXX --AWP 20-Jan-92 */
#endif /* VMS */
#if (!defined(HOST_IS) && defined(EWS))
#define HOST_IS "EWS/SVR4"
#ifndef SYSV
#define SYSV 1 /* System 5 */
#endif
#ifndef SVR4
#define SVR4 1 /* System 5 release 4 */
#endif
#define UNIX 1
#define DGXWIN 1 /* X-windows environment */
#undef PROTOTYPING
#undef ANSI_HEADER
#define ELLIPSIS ...
#define INT_EQ_LONG 1
#undef signed /* chars are unsigned */
#define const
#define volatile
#define cdecl
#endif /* EWS */
#if (!defined(HOST_IS) && defined(HP700))
#define HOST_IS "HP700"
#ifndef SYSV
#define SYSV 1 /* System 5 */
#endif
#if 0
#ifndef SVR4
#define SVR4 1 /* System 5 release 4 */
#endif
#endif
#define UNIX 1
#define DGXWIN 1 /* X-windows environment */
#define PROTOTYPING 1
#define ANSI_HEADER 1
#define ELLIPSIS ...
#define INT_EQ_LONG 1
#define SIZEOF_MACRO_OK 1
#undef signed /* chars are unsigned */
#define const
#undef volatile
#define cdecl
#define far
#endif /* HP700 */
#if (!defined(HOST_IS) && defined(IRIS))
#define HOST_IS "IRIS/SVR4"
#ifndef SYSV
#define SYSV 1 /* System 5 */
#endif
#ifndef SVR4
#define SVR4 1 /* System 5 release 4 */
#endif
#define UNIX 1
#define DGXWIN 1 /* X-windows environment */
#undef PROTOTYPING
#undef ANSI_HEADER
#define ELLIPSIS ...
#define INT_EQ_LONG 1
#undef signed /* chars are unsigned */
#define volatile
#define cdecl
#endif /* IRIS */
/**/
#if (!defined(HOST_IS) && defined(CRAY))
#define HOST_IS "CRAY/UNICOS"
#ifndef UNICOS
#define UNICOS 1
#endif
#define UNIX 1
#define DGXWIN 1 /* X-windows environment */
#undef PROTOTYPING
#undef ANSI_HEADER 1
#define ELLIPSIS ...
/* Actually, an INT is 64 bit */
#define INT_EQ_LONG 1
#undef signed /* chars are unsigned */
#define const
#define volatile
#define cdecl
#endif /* CRAY */
/**/
#if (!defined(HOST_IS) && defined(SKY))
#define HOST_IS "SKY/SUN4/SUNOS"
#define UNIX 1
#define DGXWIN 1 /* X-windows environment */
#define PROTOTYPING 1
#define ANSI_HEADER 1
#define ELLIPSIS ...
#define INT_EQ_LONG 1
#if 0
#undef signed
#endif
#define const
#define volatile
#define cdecl
#endif /* SKY */
/**/
#if (!defined(HOST_IS) && (defined(SUN)))
/*if (!defined(HOST_IS) && (defined(SUN))) */
#define HOST_IS "Sun,BSD Unix,PCC"
#define BSDC 1 /* compiler */
#if defined(SUN4SV) || defined(SUN3) || defined(SUN386)
#define SUN_KEYS 1 /* keyboard */
#define DGSUN 1 /* DG routines for SUN */
typedef char *windowhandle_t;
#else
#define DGXWIN 1
#endif
#define UNIX 1 /* UNIX operating system for special things */
#ifndef SUNOS_3
#ifndef SUNOS_4
#define SUNOS_4 1 /* default to SUN OS/4 */
#endif
#endif
#if defined(__TRANSPUTER__) || defined(__STDC__)
#define PROTOTYPING 1
#define ANSI_HEADER 1
#define ELLIPSIS ...
#else
#undef PROTOTYPING
#undef ANSI_HEADER
#define ELLIPSIS
#define void int /* Unix C doesn't handle void right */
#endif
#define INT_EQ_LONG 1 /* is this true for all SUNs? */
#define signed /* chars are signed */
#define const
#define volatile
/* Default 0 pointer type */
#ifndef NULL
#define NULL 0
#endif
/* BSD still erroneously uses index() and rindex() */
#define strchr index
#define strrchr rindex
#endif /* SUN */
/**/
#if (!defined(HOST_IS) && (defined(SOLARIS)))
#define HOST_IS "Sun,SVR4"
#ifndef SYSV
#define SYSV 1 /* System 5 */
#endif
#ifndef SVR4
#define SVR4 1 /* System 5 release 4 */
#endif
#define DGXWIN 1
#define UNIX 1 /* UNIX operating system for special things */
#define SUNOS_5 1
#define PROTOTYPING 1
#define ANSI_HEADER 1
#define ELLIPSIS ...
#define INT_EQ_LONG 1
/* Default 0 pointer type */
#ifndef NULL
#define NULL 0
#endif
#endif /* SOLARIS */
/**/
#if (!defined(HOST_IS) && (defined(MEIKO)))
#define HOST_IS "MEIKO,Sun host"
#define BSDC 1 /* compiler */
#define DGXWIN 1
#define UNIX 1 /* UNIX operating system for special things */
#define PROTOTYPING 1
#define ANSI_HEADER 1
#define ELLIPSIS ...
#define INT_EQ_LONG 1
#define signed /* chars are signed */
#define const
#define volatile
/* BSD still erroneously uses index() and rindex() */
#define strchr index
#define strrchr rindex
#endif /* MEIKO */
/**/
#if !defined(HOST_IS) && defined(XTM)
#undef XTM
#define XTM 1 /* machine */
#define UNIX 1 /* a misnomer on the XTM */
#define IBM_KEYS 1
#define HOST_IS "XTM, QIX"
#ifndef nw2pt /* is this correct ? should be in n2host.h, I think. */
#define TRANS 1
#endif
#define PROTOTYPING 1
#define ANSI_HEADER 1
#define ELLIPSIS ...
#define DGXTM 1
#define INT_EQ_LONG 1
/* Default 0 pointer type */
#ifndef NULL
#define NULL 0
#endif
/* For windowing systems, we need a handle type for windows */
typedef char *windowhandle_t;
#endif /* XTM */
/**/
#if !defined(HOST_IS) && (defined(MAC) || defined(THINK_C))
#define HOST_IS "Apple Macintosh"
#ifndef MAC
#define MAC 1
#endif
#define MACOS 1
#define DGMAC 1
#define ANSI_HEADER 1
#if defined(MPW3) || defined(THINK_C)
#define PROTOTYPING 1
#define ELLIPSIS ...
#else
#undef PROTOTYPING
#define ELLIPSIS
#endif /* mpw3 */
#define signed /* chars are signed */
#define const
#define volatile
#define INT_EQ_LONG 1
/* Default 0 pointer type */
#ifndef NULL
#define NULL 0L
#endif
#endif /* MAC */
/**/
#ifndef HOST_IS
error! error! error!
#endif
/*
* -----------------------------------------------------------------------
* SEC 4. Universal definitions which apply to everybody
* -----------------------------------------------------------------------
*/
#ifdef PROTOTYPING
#define ARGLIST(a) a
#define ARGS(a) a
#define _A0 void
#else
#define ARGLIST(a) ()
#define ARGS(a) ()
#define _A0
#endif
#define BITSPERBYTE 8
typedef long SL; /* signed long */
#define xdr_sl xdr_long
typedef unsigned long UL; /* unsigned long */
#define xdr_ul xdr_u_long
typedef short SW; /* signed word */
#define xdr_sw xdr_short
typedef unsigned short UW; /* unsigned word */
#define xdr_uw xdr_u_short
typedef char XB; /* unknown byte type */
#define xdr_xb xdr_char
typedef unsigned char UB; /* unsigned byte */
#define xdr_ub xdr_u_char
typedef int NINT; /* native integer */
#define xdr_nint xdr_int
typedef unsigned int UNINT; /* unsigned native integer */
typedef double REAL; /* floating point number */
#define xdr_real xdr_double
typedef float SREAL; /* short real */
#define xdr_sreal xdr_float
#ifndef NW2tm /* conflict with cstools/build.h */
typedef char TEXT; /* text string */
#endif
#define VOID void
#define FAST register /* fast definitions */
#define NORMTERM 0 /* Normal exit condition */
#define ERRTERM 1 /* error exit condition */
#define LOCAL static /* local variables */
/* EXPORTs and IMPORTs */
#define IMPORT extern /* external (proc) reference */
#define EXPORT /* declare an external (proc) */
#if defined(VMS)
#define GLOBALREF globalref /* external (data) reference */
#define GLOBALDEF globaldef /* declare an external (datum) */
#else
#define GLOBALREF extern
#define GLOBALDEF
#endif
#define ASof(x) (sizeof((x))/sizeof(x[0]))
/*
* -----------------------------------------------------------------------
* SEC 5. definitions which vary depending upon compiler or platform
* -----------------------------------------------------------------------
*/
#ifdef SUN
typedef char MVOID;
#else
#define MVOID void
#endif
#ifdef MAC
typedef short bool;
#else
typedef int bool;
#endif
#ifdef INT_EQ_SHORT
#define MAXINT 0x7FFF
#define MININT 0x8000
#define INT_16 int
#define INT_32 long
#define xdr_int32 xdr_long
#endif
#ifdef INT_EQ_LONG
#define MAXINT 0x7FFFFFFF
#define MININT 0x80000000
#define INT_16 short
#define INT_32 int
#define xdr_int32 xdr_int
#endif
#ifdef SIZEOF_MACRO_OK
#define SIZEOFINT sizeof(int)
#define SIZEOFLONG sizeof(long)
#else /* preprocessor chokes on sizeof(int) in a MACRO */
#define SIZEOFSHORT 2
#define SIZEOFLONG 4
#ifdef INT_EQ_LONG
#define SIZEOFINT SIZEOFLONG
#else
#define SIZEOFINT SIZEOFSHORT
#endif /* not INT_EQ_LONG */
#endif /* not SIZEOF_MACRO_OK */
#define NRZRO (.000001) /* close enough to zero */
#ifdef MSDOS
#define FNLEN 8 /* max length for a file name */
#define FN_DISP_LEN FNLEN /* The display portion of file */
#define FNXLEN 12 /* extended length */
#endif /* MSDOS */
#if defined(UNIX)
#define FNLEN 40 /* max length for a file name */
#define FN_DISP_LEN 8 /* The display portion of file */
#define FNXLEN 120 /* extended length */
#endif /* SUN */
#ifdef MAC
#define FNLEN 27 /* max length for a file name */
#define FN_DISP_LEN 8 /* The display portion of file */
#define FNXLEN 31 /* extended length */
#endif /* MAC */
#define ALIGN(x,a) (((x)+(a-1))&(-(a))) /* alignment macro */
#define L4A(x) ALIGN(x,4) /* 4-byte alignment */
#define FNALC L4A(FNLEN+1) /* space to allocate */
#define FNXALC L4A(FNXLEN+1) /* space to allocate */
/* remove unused macros */
#undef INT_EQ_LONG
#undef INT_EQ_SHORT
/* A story: ( TM, 1/23/91 )
According to the Harbison-Steele reference, ANSI C permits void
in a function prototype, but not in a function definition, to
indicate that the function accepts no arguments.
Some compilers, otherwise ANSI compliant, require that the definition
use "void" to match the prototype. To solve this sticky problem,
use NO_ARGS in function definitions only.
*/
#if defined(__TRANSPUTER__) || defined(M_I86) || defined(RS6) || defined(PS2AIX)
#define NO_ARGS void
#else
#define NO_ARGS
#endif
/* Older Unix machines use varargs.h to support a portable method for
handling multiple arguments. Newer compilers supply ANSI standard
stdarg.h */
#undef USE_VARARGS
#if defined(SUN) || defined(EWS) || defined(CRAY) || defined(IRIS)
/* force VARARGS */
#define USE_VARARGS 1
#endif
#ifdef USE_VARARGS
#include <varargs.h>
#define VA_START(argp, last_arg) va_start(argp)
#define VA_ALIST ,va_alist
#else
#include <stdarg.h>
#define VA_START(argp, last_arg) va_start(argp, last_arg)
#define va_dcl
#define VA_ALIST
#endif
#if defined(unix) && !defined(I860) && !defined(EWS) && !defined(CRAY) && !defined(IRIS) && !defined(SOLARIS)
#define BSDUNIX 1
#endif
#ifndef DP_RUN
#ifdef DGXWIN
/* the TEMP_UNIX kludge is attempt to fix problem with a duplicate use
of UNIX under VMS systems */
#ifdef UNIX
#define TEMP_UNIX 1
#undef UNIX
#endif
#include <X11/Intrinsic.h>
#include <X11/keysym.h>
#if defined(VMS)
#include <X11/DwtAppl.h> /* major VMS grab; --AWP, 8-May-91 */
#endif
#ifdef TEMP_UNIX
#define UNIX 1
#undef TEMP_UNIX
#endif
#define FLIP_Y( value ) ((dg_displaybox[3] - (value)))
typedef Widget windowhandle_t;
#endif /* DGXWIN */
#endif /* not DPTEST */
/* MSDOS compiler support for far pointers */
#if defined(__ZTC__)
#define ZFAR far
#define FAR far
#else
#define ZFAR
#if defined(_MSC_VER)
#define FAR _far
#else
#if defined(__TURBOC__)
#define FAR far
#else
#define FAR
#endif /* __TURBOC__ */
#endif /* _MSC_VER */
#endif /* __ZTC__ */
#define VOIDF VOID ZFAR
/* some compilers require (VOID *) cast */
#if defined(SUN) || defined(XTM) || defined(TRANS_PHYS) || defined(VAXULT) || defined(VMS)
#define VP (VOID *) /* may cast vars as "(void*)ptr" */
#else
#define VP
#endif
/* process control, initiation and termination */
#ifndef XTM
#define USAGE_STRC 1 /* Usage structure passed to wait4 function */
#endif
/* Note: SUNOS_4 has a wait4( ); following are redefinitions for other
systems to improve readability */
#if defined(RS6) || defined(SYSV) || defined(PS2AIX)
#define wait4(pid,sp,opt,use) waitpid(pid,sp,opt)
#undef USAGE_STRC
#else
#if defined(SUNOS_3) || defined(NEXT) || defined(VAXULT) || defined(VMS)
#define wait4(pid,sp,opt,use) wait3(sp,opt,use)
#endif
#endif
#if defined(RS6) || defined(NEXT) || defined(SYSV) || defined(PS2AIX)
#define vfork fork
#endif
/*
* Inclusions (INCxxxxx)
*/
/* --- strings.h or alternates --- */
#if defined(BSDUNIX) && !defined(SKY) && !defined(VMS) /* INCSTRINGS */
#define INCSTRINGS /* use <strings.h> (else <string.h>) */
#endif /* note: VMS requires <string.h> */
/* --- sys/types.h or alternates --- */
#if (defined(UNIX) && !defined(VMS)) || defined(MSC) || defined(__ZTC__) || defined(IBP) || defined(__TURBOC__) || defined(SKY)
/* define INCSYSTYPES */
#define INCSYSTYPES /* use <sys/types.h> (most common) */
#else
#if defined(M860)
/* define INCMYRIADTYPES */
#define INCMYRIADTYPES /* use <myriad.h>, not <sys/types> */
#else
#if !defined(THINK_C) /* (use nothing) */
/* define INCTYPES */
#define INCTYPES /* fallthru: use <types.h> */
#endif
#endif
#endif /* types.h */
/* --- sys/file.h or alternates --- */
#if !defined(VAXULT) && !defined(MSDOS) && !defined(VMS)
/* dg: BSDUNIX. NEXT? RS6? XTM? ... */
#define INCSYSFILE /* INCSYSFILE */
#else /* use <sys/file.h> (most common) */
#define INCFILE
#endif /* else use <file.h> */
/* --- sys/vm.h or alternates --- */
#if defined(VAXULT) || defined(EWS) || defined(VMS) || defined(IRIS) || defined (SOLARIS)
#define INCSYSVM /* use <sys/vm.h> */
#else
#define INCVM /* else use <vm.h> */
#endif
/*
* External References (EXTxxxxx)
*/
/* EXTMEMMOVE ------------------------- */
#if defined(BSDUNIX) && !defined(VAXULT) && !defined(VMS)
#define EXTMEMMOVE /* extern memmove() */
#endif
/* EXTSTDERR ------------------------- */
/* seems to be everyone but MS-DOS */
#if defined(MAC) || defined(UNIX) || defined(NEXT) || defined(IBP) || defined(I860)
#define EXTSTDERR 1 /* use "stderr" else "stdprn" */
#endif
/*
* Signal handling function pointer
*/
#if defined(UNIX)
#ifdef BSDUNIX
typedef int (*SIG_FUNC_PTR) ();
#else
typedef void (*SIG_FUNC_PTR) ();
#endif
#endif
/*
* Macro Activiation (MACxxxxx)
*/
/* ( CPP can't handle arithmetic - see nw2/n2menu.c ) */
#if defined(UNIX)
#define MACNOARITH
#endif
/*
* Code Segment Activiation (SRCxxxxx)
*/
#if !defined(VMS) && !defined(VAXULT)
#define SRCCASTLONG /* SRCCASTLONG */
#endif /* supports: "*(long*)(ch) = -1" */
#if defined(MSDOS) && !defined(IBP)
#define SRCVM /* SRCVM */
#endif /* enable body of "src/tk/if/vm.c" */
/*
* Function and Procedure Activiation (FUNxxxxx)
*/
/* String Duplication */
#if defined(RS6) || defined(PS2AIX)
#define ZREFSTRDUP 1
#endif
#if defined(MAC) || defined(XTM) || defined(VAXULT) || defined(VMS) || defined(SKY)
#define FUNSTRDUP 1
#endif
#if defined(FUNSTRDUP) || defined(ZDEFSTRING)
char *strdup ARGLIST(( char * )); /* this is supposed to be in string.h but it's not */
#endif
/*
.
....... empty for now .......
.
*/
/*
* General (Misc) Use (USExxxxx)
*/
/* ------------------------------------ */
/* ANY other wierdnesses looking for a home... */
#endif /* HOST_H */